<template>
	<view>
		
		<view class="autonym">
			<p>修改密码</p><span>></span>
		</view>
		<view class="autonym" @click="quit">
			<p >退出登录</p><span>></span>
		</view>
		
		
		
	</view>
</template>

<script setup>
	import { logout } from "@/api/login.js";
	
	const quit = async() => {
		try {
			const res = await logout()
			uni.setStorageSync('token', '');
			console.log(uni.getStorageSync('token'))
			
			if(res.code == 1){
				uni.navigateBack({
				    delta: 1,
				    animationType: 'pop-out',
				    animationDuration: 1000,
				});
				console.log('成功退出登录')
			}else{
				console.log('退出登录失败')
			}
		} catch (error) {
			console.log('退出过程中出现错误',error)
		}
	}
	
	
</script>

<style lang="scss" scoped>
	
	.autonym{
		width: 100%;
		height: 60px;
		display: block;
		margin: 0 auto;
		position: relative;
		background-color: #F5F5F5;
		display: flex;
		align-items: center;
		border-bottom: 0.5px solid #d7d7d7;
	}
	.autonym p{
		margin-left: 20px;
		font-size: 17px;
		// background-color: #ff00ff;
	}
	.autonym span{
		// background-color: #55aa7f;
		position: absolute;
		right: 20px;
		color: #000000;
	}
	
</style>
